﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataBaseManager;

namespace BLGPS
{
    public class ColeccionChofer:List<Chofer>
    {
        public static ColeccionChofer CargarPorEmpresa(Empresa empresa)
        {
            //return Testing.CrearChoferes();
 
            ParameterManager parameters = new ParameterManager() { new Parameter("idEmpresa",empresa.Id)};
            return BaseDatos.DB.Load<ColeccionChofer, Chofer>(BaseDatos.DB.Select(MyTables.Chofer, parameters));  
        }

        public Chofer  ObtenerPorId(decimal pId)
        {
            foreach (Chofer  m in this)
            {
                if (m.Id == pId) return m;
            }
            return null;
        }
    }
}
